<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>docker安装各软件（汇总） | 清峰小栈</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  <meta name="keywords" content="docker" />
  
  
  
  
  <meta name="description" content="Docker安装各软件（汇总）一、docker安装oracle-12c1、拉取oracle-12c镜像启动「Docker Desktop」后在cmd窗口中执行docker search oracle命令，搜索Oracle相关的镜像，可以看到搜索结果中的「truevoly&#x2F;oracle-12c」 12# 拉取镜像(默认下载oracle-12c最新版本的镜像)docker pull true">
<meta property="og:type" content="article">
<meta property="og:title" content="docker安装各软件（汇总）">
<meta property="og:url" content="http://example.com/2023/04/19/%E8%BF%90%E7%BB%B4%E5%AE%89%E8%A3%85/Linux%20docker%E5%AE%89%E8%A3%85%E5%90%84%E8%BD%AF%E4%BB%B6(%E6%B1%87%E6%80%BB)/index.html">
<meta property="og:site_name" content="清峰小栈">
<meta property="og:description" content="Docker安装各软件（汇总）一、docker安装oracle-12c1、拉取oracle-12c镜像启动「Docker Desktop」后在cmd窗口中执行docker search oracle命令，搜索Oracle相关的镜像，可以看到搜索结果中的「truevoly&#x2F;oracle-12c」 12# 拉取镜像(默认下载oracle-12c最新版本的镜像)docker pull true">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="http://img.lindaifeng.vip/typora-picgo-tuchaung/20230425140406.png">
<meta property="og:image" content="http://img.lindaifeng.vip/typora-picgo-tuchaung/20230425140423.png">
<meta property="og:image" content="http://img.lindaifeng.vip/typora-picgo-tuchaung/20230425140440.png">
<meta property="og:image" content="http://img.lindaifeng.vip/typora-picgo-tuchaung/20230419200402.png">
<meta property="article:published_time" content="2023-04-19T09:49:01.240Z">
<meta property="article:modified_time" content="2023-05-26T09:20:27.207Z">
<meta property="article:author" content="清峰">
<meta property="article:tag" content="docker">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://img.lindaifeng.vip/typora-picgo-tuchaung/20230425140406.png">
  

  

  <link rel="icon" href="/qingfeng-blog/css/images/mylogo-2.png">
  <link rel="apple-touch-icon" href="/qingfeng-blog/css/images/mylogo-2.png">
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link href="https://fonts.googleapis.com/css?family=Open+Sans|Montserrat:700" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic" rel="stylesheet" type="text/css">
  <!-- <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> -->
  <link href="/qingfeng-blog/css/font-awesome.css" rel="stylesheet">
  <style type="text/css">
    @font-face{font-family:futura-pt; src:url("/qingfeng-blog/css/fonts/FuturaPTBold.otf") format("woff");font-weight:500;font-style:normal;}
    @font-face{font-family:futura-pt-light; src:url("/qingfeng-blog/css/fonts/FuturaPTBook.otf") format("woff");font-weight:lighter;font-style:normal;}
    @font-face{font-family:futura-pt-italic; src:url("/qingfeng-blog/css/fonts/FuturaPTBookOblique.otf") format("woff");font-weight:400;font-style:italic;}
}

  </style>
  
<link rel="stylesheet" href="/qingfeng-blog/css/style.css">


  
<script src="/qingfeng-blog/js/jquery-3.1.1.min.js"></script>

  
<script src="/qingfeng-blog/js/bootstrap.js"></script>


  <!-- Bootstrap core CSS -->
  <link rel="stylesheet" href="/qingfeng-blog/css/bootstrap.css" >

  
    
<link rel="stylesheet" href="/qingfeng-blog/css/dialog.css">

  

  

  
    <link rel="stylesheet" href="/qingfeng-blog/css/header-post.css" >
  

  
  
  
    <link rel="stylesheet" href="/qingfeng-blog/css/vdonate.css" >
  

<meta name="generator" content="Hexo 6.3.0"></head>



  <body data-spy="scroll" data-target="#toc" data-offset="50">


  
  <div id="container">
    <div id="wrap">
      
        <header>

    <div id="allheader" class="navbar navbar-default navbar-static-top" role="navigation">
        <div class="navbar-inner">
          
          <div class="container"> 
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>

            
              <a class="brand" style="
                 border-width: 0px;  margin-top: 0px;"  
                href="#" data-toggle="modal" data-target="#myModal" >
                  <img width="155px" height="90px" alt="Hike News" src="/qingfeng-blog/css/images/mylogo-2.png">
              </a>
            
            
            <div class="navbar-collapse collapse">
              <ul class="hnav navbar-nav">
                
                  <li> <a class="main-nav-link" href="/qingfeng-blog/">首页</a> </li>
                
                  <li> <a class="main-nav-link" href="/qingfeng-blog/categories">分类</a> </li>
                
                  <li> <a class="main-nav-link" href="/qingfeng-blog/tags">标签</a> </li>
                
                  <li><div id="search-form-wrap">

    <form class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="" />
        <button type="submit" class="search-form-submit"></button>
    </form>
    <div class="ins-search">
    <div class="ins-search-mask"></div>
    <div class="ins-search-container">
        <div class="ins-input-wrapper">
            <input type="text" class="ins-search-input" placeholder="Type something..." />
            <span class="ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: 'Posts',
            PAGES: 'Pages',
            CATEGORIES: 'Categories',
            TAGS: 'Tags',
            UNTITLED: '(Untitled)',
        },
        ROOT_URL: '/qingfeng-blog/',
        CONTENT_URL: '/qingfeng-blog/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>

<script src="/qingfeng-blog/js/insight.js"></script>


</div></li>
            </div>
          </div>
                
      </div>
    </div>

</header>



      
            
      <div id="content" class="outer">
        
          <section id="main" style="float:none;"><article id="post-运维安装/Linux docker安装各软件(汇总)" style="width: 75%; float:left;" class="article article-type-post" itemscope itemprop="blogPost" >
<div id="container">
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" class="article-title" itemprop="name">
      docker安装各软件（汇总）
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/qingfeng-blog/2023/04/19/%E8%BF%90%E7%BB%B4%E5%AE%89%E8%A3%85/Linux%20docker%E5%AE%89%E8%A3%85%E5%90%84%E8%BD%AF%E4%BB%B6(%E6%B1%87%E6%80%BB)/" class="article-date">
	  <time datetime="2023-04-19T09:49:01.240Z" itemprop="datePublished">2023-04-19</time>
	</a>

      
    <a class="article-category-link" href="/qingfeng-blog/categories/Docker/">Docker</a>

      
	<a class="article-views">
	<span id="busuanzi_container_page_pv">
		PV:<span id="busuanzi_value_page_pv"></span>
	</span>
	</a>

      

    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="Docker安装各软件（汇总）"><a href="#Docker安装各软件（汇总）" class="headerlink" title="Docker安装各软件（汇总）"></a>Docker安装各软件（汇总）</h2><h2 id="一、docker安装oracle-12c"><a href="#一、docker安装oracle-12c" class="headerlink" title="一、docker安装oracle-12c"></a>一、docker<strong>安装oracle-12c</strong></h2><h3 id="1、拉取oracle-12c镜像"><a href="#1、拉取oracle-12c镜像" class="headerlink" title="1、拉取oracle-12c镜像"></a><strong>1、拉取oracle-12c镜像</strong></h3><p>启动<strong>「Docker Desktop」</strong>后在cmd窗口中执行<code>docker search oracle</code>命令，搜索Oracle相关的镜像，可以看到搜索结果中的<strong>「truevoly&#x2F;oracle-12c」</strong></p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># 拉取镜像(默认下载oracle<span class="number">-12</span>c最新版本的镜像)</span><br><span class="line">docker pull truevoly<span class="operator">/</span>oracle<span class="number">-12</span>c</span><br></pre></td></tr></table></figure>

<h3 id="2、创建并启动容器"><a href="#2、创建并启动容器" class="headerlink" title="2、创建并启动容器"></a><strong>2、创建并启动容器</strong></h3><p>cmd中执行以下命令，在docker中创建并启动一个oracle-12c容器，<strong>「对物理机暴露2122、9090和1521三个端口分别映射到容器内的22、8080和1521端口」</strong>，并且将容器内的oracle目录<strong>「挂载」</strong>到物理机的D盘中</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">#创建目录</span><br><span class="line">mkdir -p /var/oracle/data/</span><br><span class="line">#赋予权限</span><br><span class="line">chmod -R 777 /var/oracle/data/</span><br><span class="line">#启动容器</span><br><span class="line">docker run -d -p 8080:8080 -p 1521:1521 -v /var/oracle/data/:/u01/app/oracle/ truevoly/oracle-12c</span><br><span class="line"></span><br><span class="line">#推荐使用（限制内存上限，允许外部访问）</span><br><span class="line">docker run --name oracle-12c -e ORACLE_ALLOW_REMOTE=true -p 8080:8080 -p 1521:1521 --memory=4g -v /var/oracle/data/:/u01/app/oracle/ -d truevoly/oracle-12c</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>查看容器启动日志（看到<strong>「Import finished Database ready to use. Enjoy!」</strong> 即容器创建并启动完成）</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># 查看oracle<span class="number">-12</span>c启动日志</span><br><span class="line">docker logs <span class="operator">-</span>f oracle<span class="number">-12</span>c</span><br></pre></td></tr></table></figure>

<p><img src="http://img.lindaifeng.vip/typora-picgo-tuchaung/20230425140406.png" alt="image-20230425140406861"></p>
<p><img src="http://img.lindaifeng.vip/typora-picgo-tuchaung/20230425140423.png" alt="image-20230425140422986"></p>
<p>若日志中出现以下报错，是因为对外暴露的端口不可用访问权限已被禁止，只要更改创建容器时对外暴露的端口即可</p>
<figure class="highlight text"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:1521 -&gt; 0.0.0.0:0: listen tcp 0.0.0.0:1521: bind: An attempt was made to access a socket in a way forbidden by its access permissions.</span><br></pre></td></tr></table></figure>

<p>可在cmd中执行以下命令查看哪些端口被禁用TCP协议</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># windows cmd命令查看哪些端口被禁用TCP协议</span><br><span class="line">netsh interface ipv4 <span class="keyword">show</span> excludedportrange protocol<span class="operator">=</span>tcp</span><br></pre></td></tr></table></figure>

<h3 id="3、修改oracle账号密码设置"><a href="#3、修改oracle账号密码设置" class="headerlink" title="3、修改oracle账号密码设置"></a><strong>3、修改oracle账号密码设置</strong></h3><p>truevoly&#x2F;oracle-12c镜像创建的容器<strong>「默认有<code>sys</code>和<code>system</code>两个用户，密码都是<code>oracle</code>，默认的一个SID&#x2F;服务名是xe」</strong>，Oracle的用户密码默认有效期是180天，180天后用户会自动锁住，下面进入oracle-12c容器内将密码的有效期设置为永久！</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"># 进入oracle<span class="number">-12</span>c容器内</span><br><span class="line">docker <span class="keyword">exec</span> <span class="operator">-</span>it oracle<span class="number">-12</span>c <span class="operator">/</span>bin<span class="operator">/</span>bash</span><br><span class="line"># 切换成oracle用户</span><br><span class="line">su oracle</span><br><span class="line"># 进入sqlplus</span><br><span class="line">$ORACLE_HOME<span class="operator">/</span>bin<span class="operator">/</span>sqlplus <span class="operator">/</span> <span class="keyword">as</span> sysdba</span><br><span class="line"># 设置密码有效期为无限制</span><br><span class="line"><span class="keyword">SQL</span><span class="operator">&gt;</span> <span class="keyword">ALTER</span> PROFILE <span class="keyword">DEFAULT</span> LIMIT PASSWORD_LIFE_TIME UNLIMITED;</span><br><span class="line"># 解锁<span class="keyword">system</span>用户</span><br><span class="line"><span class="keyword">SQL</span><span class="operator">&gt;</span> <span class="keyword">alter</span> <span class="keyword">user</span> <span class="keyword">SYSTEM</span> account unlock;</span><br></pre></td></tr></table></figure>

<h3 id="4、物理机连接oracle-12c"><a href="#4、物理机连接oracle-12c" class="headerlink" title="4、物理机连接oracle-12c"></a><strong>4、物理机连接oracle-12c</strong></h3><p>使用PL&#x2F;SQL或Navicat等工具测试连接oracle-12c</p>
<p><img src="http://img.lindaifeng.vip/typora-picgo-tuchaung/20230425140440.png" alt="image-20230425140440589"></p>
<h3 id="拓展"><a href="#拓展" class="headerlink" title="拓展"></a><strong>拓展</strong></h3><h3 id="Oracle创建表空间与用户"><a href="#Oracle创建表空间与用户" class="headerlink" title="Oracle创建表空间与用户"></a><strong>Oracle创建表空间与用户</strong></h3><p>以下创建一个<code>ling_mf3</code>数据表空间</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- 创建ling_mf3数据表空间</span></span><br><span class="line"><span class="keyword">create</span> <span class="keyword">table</span>space ling_mf3 datafile <span class="string">&#x27;/u01/app/oracle/data/ling_mf3.dbf&#x27;</span> size <span class="number">50</span>M;</span><br></pre></td></tr></table></figure>

<p>创建表空间成功，同时也会在挂载的目录下生成相应数据文件</p>
<p>以下创建一个用户<code>ling</code>并授权，且设置<code>ling_mf3</code>为它的默认表空间</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- 创建ling用户密码为meet0and1#202302并设置ling_mf3为它的默认表空间</span></span><br><span class="line"><span class="keyword">create</span> <span class="keyword">user</span> ling identified <span class="keyword">by</span> &quot;meet0and1#202302&quot; <span class="keyword">default</span> tablespace ling_mf3;</span><br><span class="line"><span class="comment">-- 给用户ling授权 dba：管理员的权限</span></span><br><span class="line"><span class="keyword">grant</span> <span class="keyword">connect</span>,resource,dba <span class="keyword">to</span> ling;</span><br></pre></td></tr></table></figure>



<h3 id="重启Oracle服务"><a href="#重启Oracle服务" class="headerlink" title="重启Oracle服务"></a><strong>重启Oracle服务</strong></h3><p>在<strong>「Docker Desktop」</strong>中可以一键重启，但实际开发中一般是在Linux环境中，我这里演示用命令重启Oracle服务</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- 查看监听状态</span></span><br><span class="line">lsnrctl status</span><br><span class="line"><span class="comment">-- 停监听</span></span><br><span class="line">lsnrctl stop</span><br><span class="line">sqlplus <span class="operator">/</span> <span class="keyword">as</span> sysdba</span><br><span class="line"><span class="comment">-- 停止oracle</span></span><br><span class="line"><span class="keyword">SQL</span><span class="operator">&gt;</span>shutdown immediate;</span><br><span class="line"><span class="comment">-- 启服务</span></span><br><span class="line"><span class="keyword">SQL</span><span class="operator">&gt;</span>startup;</span><br><span class="line"><span class="keyword">SQL</span><span class="operator">&gt;</span>exit</span><br><span class="line"><span class="comment">-- 启监听</span></span><br><span class="line">lsnrctl <span class="keyword">start</span></span><br></pre></td></tr></table></figure>

<h3 id="更多常用…"><a href="#更多常用…" class="headerlink" title="更多常用…"></a><strong>更多常用…</strong></h3><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- 删除表空间</span></span><br><span class="line"><span class="keyword">drop</span> tablespace ling_mf3;</span><br><span class="line"></span><br><span class="line"><span class="comment">-- 查询所有的表空间</span></span><br><span class="line"><span class="keyword">select</span> tablespace_name <span class="keyword">from</span> dba_tablespaces;</span><br><span class="line"></span><br><span class="line"><span class="comment">-- 查看当前的用户和表空间</span></span><br><span class="line"><span class="keyword">select</span> username,default_tablespace <span class="keyword">from</span> user_users;</span><br><span class="line"></span><br><span class="line"><span class="comment">-- 查看当前用户的角色</span></span><br><span class="line"><span class="keyword">select</span> <span class="operator">*</span> <span class="keyword">from</span> user_role_privs;</span><br><span class="line"><span class="comment">-- 查询实例名/SID/服务名</span></span><br><span class="line"><span class="keyword">select</span> instance_name <span class="keyword">from</span> v$instance;</span><br><span class="line"></span><br><span class="line"><span class="comment">-- 查看Oracle版本</span></span><br><span class="line"><span class="keyword">select</span> <span class="operator">*</span> <span class="keyword">from</span> v$version;</span><br><span class="line"></span><br><span class="line"><span class="comment">-- 查看数据库允许的最大连接数</span></span><br><span class="line"><span class="keyword">select</span> <span class="keyword">value</span> <span class="keyword">from</span> v$<span class="keyword">parameter</span> <span class="keyword">where</span> name <span class="operator">=</span> <span class="string">&#x27;processes&#x27;</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">-- 查看当前连接数</span></span><br><span class="line"><span class="keyword">select</span> <span class="built_in">count</span>(<span class="operator">*</span>) <span class="keyword">from</span> v$process;</span><br><span class="line"></span><br><span class="line"><span class="comment">-- 查看数据库当前会话的连接数</span></span><br><span class="line"><span class="keyword">select</span> <span class="built_in">count</span>(<span class="operator">*</span>) <span class="keyword">from</span> v$session;</span><br><span class="line"></span><br><span class="line"><span class="comment">-- 查看数据库当前的并发连接数</span></span><br><span class="line"><span class="keyword">select</span> <span class="built_in">count</span>(<span class="operator">*</span>) <span class="keyword">from</span> v$session <span class="keyword">where</span> status <span class="operator">=</span> <span class="string">&#x27;ACTIVE&#x27;</span>;</span><br></pre></td></tr></table></figure>



<h2 id="二、docker安装mysql"><a href="#二、docker安装mysql" class="headerlink" title="二、docker安装mysql"></a>二、docker安装mysql</h2><p><strong>思路：</strong><br>1、创建相应目录<br>2、创建配置文间<br>3、运行容器<br>4、进入容器内部修改root登录权限<br>5、测试连接（如果是云服务器，需要在防火墙开通相应端口）</p>
<h3 id="创建第一台mysql-1"><a href="#创建第一台mysql-1" class="headerlink" title="创建第一台mysql-1"></a>创建第一台mysql-1</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line">1、创建相应目录</span><br><span class="line">mkdir -p /var/mysql-1/&#123;data,logs,conf&#125;</span><br><span class="line">chmod 777 /var/mysql-1/logs -R</span><br><span class="line">2、创建配置文件(文件内容已放最下面，直接复制即可)</span><br><span class="line">vim /var/mysql-1/conf/mysql.cnf</span><br><span class="line"></span><br><span class="line">[mysqld]</span><br><span class="line"></span><br><span class="line">datadir=/var/mysql-1/mysql</span><br><span class="line"> </span><br><span class="line">socket=/var/mysql-1/mysql/mysql.sock</span><br><span class="line"> </span><br><span class="line">symbolic-links=0</span><br><span class="line"> </span><br><span class="line">lower_case_table_names=1</span><br><span class="line">[client]</span><br><span class="line">socket=/var/mysql-2/mysql/mysql.sock</span><br><span class="line"></span><br><span class="line">3、运行容器</span><br><span class="line">docker run -d --name=&quot;mysql-1&quot; -p 3306:3306 -v /var/mysql-1/conf/:/etc/mysql/conf.d -v /var/mysql-1/data:/var/lib/mysql -v /var/mysql-1/logs:/var/log -e MYSQL_ROOT_PASSWORD=&quot;Zz@2022&quot; mysql:5.7</span><br><span class="line"></span><br><span class="line">4、进入容器内部修改root登录权限</span><br><span class="line">docker exec -it mysql bash</span><br><span class="line">mysql -h 127.0.0.1 -P 3306 -u root -uroot -p&#x27;Zz@2022&#x27;</span><br><span class="line">mysql&gt; grant all privileges on *.* to &#x27;root&#x27;@&#x27;%&#x27; identified by &#x27;Zz@2022&#x27;;</span><br><span class="line">mysql&gt; flush privileges;</span><br></pre></td></tr></table></figure>



<h3 id="创建第二台mysql-2"><a href="#创建第二台mysql-2" class="headerlink" title="创建第二台mysql-2"></a>创建第二台mysql-2</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">1、创建相应目录</span><br><span class="line">mkdir -p /var/mysql-2/&#123;data,logs,conf&#125;</span><br><span class="line">chmod 777 /var/mysql-2/logs -R</span><br><span class="line">2、创建配置文件(文件内容已放最下面，直接复制即可)</span><br><span class="line">vi /var/mysql-2/conf/mysql.cnf</span><br><span class="line"></span><br><span class="line">[mysqld]</span><br><span class="line"></span><br><span class="line">datadir=/var/mysql-2/mysql</span><br><span class="line"> </span><br><span class="line">socket=/var/mysql-2/mysql/mysql.sock</span><br><span class="line"> </span><br><span class="line">symbolic-links=0</span><br><span class="line"> </span><br><span class="line">lower_case_table_names=1</span><br><span class="line"></span><br><span class="line">[client]</span><br><span class="line">socket=/var/mysql-2/mysql/mysql.sock</span><br><span class="line"></span><br><span class="line">3、运行容器</span><br><span class="line">docker run -d --name=&quot;mysql-2&quot; -p 3307:3306 -v /var/mysql-2/conf/:/etc/mysql/conf.d -v /var/mysql-2/data:/var/lib/mysql -v /var/mysql-2/logs:/var/log -e MYSQL_ROOT_PASSWORD=&quot;Zz@2022&quot; mysql:5.7</span><br><span class="line"></span><br><span class="line">4、进入容器内部修改root登录权限</span><br><span class="line">docker exec -it mysql bash</span><br><span class="line">mysql -h 127.0.0.1 -P 3306 -u root -uroot -p&#x27;Zz@2022&#x27;</span><br><span class="line">mysql&gt; grant all privileges on *.* to &#x27;root&#x27;@&#x27;%&#x27; identified by &#x27;Zz@2022&#x27;;</span><br><span class="line">mysql&gt; flush privileges;</span><br></pre></td></tr></table></figure>

<p><img src="http://img.lindaifeng.vip/typora-picgo-tuchaung/20230419200402.png" alt="image-20230419200402414"></p>
<p>启动显示以下内容，为启动成功</p>
<blockquote>
<p>Version: ‘5.7.36’  socket: ‘&#x2F;var&#x2F;run&#x2F;mysqld&#x2F;mysqld.sock’  port: 3306  MySQL Community Server (GPL)</p>
</blockquote>
<p>参数说明：</p>
<ul>
<li><strong>-p 3306:3306</strong>：将容器的 3306 端口映射到宿主机的 3306 端口。</li>
<li><strong>-v $PWD&#x2F;conf:&#x2F;etc&#x2F;mysql&#x2F;conf.d</strong>：将主机当前目录下的 conf&#x2F;my.cnf 挂载到容器的 &#x2F;etc&#x2F;mysql&#x2F;my.cnf。配置目录</li>
<li><strong>-v $PWD&#x2F;logs:&#x2F;logs</strong>：将主机当前目录下的 logs 目录挂载到容器的 &#x2F;logs。日志目录</li>
<li><strong>-v $PWD&#x2F;data:&#x2F;var&#x2F;lib&#x2F;mysql</strong> ：将主机当前目录下的data目录挂载到容器的 &#x2F;var&#x2F;lib&#x2F;mysql 。数据目录</li>
<li><strong>-e MYSQL_ROOT_PASSWORD&#x3D;123456：</strong>初始化 root 用户的密码。</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br></pre></td><td class="code"><pre><span class="line">cd /home/dockerdata/mysql/conf/</span><br><span class="line">vi my.cnf</span><br><span class="line"></span><br><span class="line"># Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.</span><br><span class="line">#</span><br><span class="line"># This program is free software; you can redistribute it and/or modify</span><br><span class="line"># it under the terms of the GNU General Public License as published by</span><br><span class="line"># the Free Software Foundation; version 2 of the License.</span><br><span class="line">#</span><br><span class="line"># This program is distributed in the hope that it will be useful,</span><br><span class="line"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span class="line"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span class="line"># GNU General Public License for more details.</span><br><span class="line">#</span><br><span class="line"># You should have received a copy of the GNU General Public License</span><br><span class="line"># along with this program; if not, write to the Free Software</span><br><span class="line"># Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</span><br><span class="line"></span><br><span class="line">#</span><br><span class="line"># The MySQL  Server configuration file.</span><br><span class="line">#</span><br><span class="line"># For explanations see</span><br><span class="line"># http://dev.mysql.com/doc/mysql/en/server-system-variables.html</span><br><span class="line"></span><br><span class="line">[mysqld]</span><br><span class="line">pid-file	= /var/run/mysqld/mysqld.pid</span><br><span class="line">socket		= /var/run/mysqld/mysqld.sock</span><br><span class="line">datadir		= /var/lib/mysql</span><br><span class="line">#log-error	= /var/log/mysql/error.log</span><br><span class="line"># Disabling symbolic-links is recommended to prevent assorted security risks</span><br><span class="line">symbolic-links=0</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">max_connections = 2000</span><br><span class="line">max_user_connections = 1900</span><br><span class="line">max_connect_errors = 100000</span><br><span class="line">max_allowed_packet = 50M</span><br><span class="line">lower_case_table_names=1</span><br><span class="line">[mysqld]</span><br><span class="line">skip-name-resolve</span><br><span class="line"></span><br><span class="line">#保存后退出</span><br></pre></td></tr></table></figure>



<p><strong>修改密码</strong>：version8.0+</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">ALTER USER &#x27;root&#x27;@&#x27;localhost&#x27; IDENTIFIED WITH mysql_native_password BY &quot;ST1q@W3e4r&quot;;</span><br><span class="line">ALTER USER &#x27;root&#x27;@&#x27;%&#x27; IDENTIFIED WITH mysql_native_password BY &quot;ST1q@W3e4r&quot;;</span><br><span class="line">flush privileges;</span><br></pre></td></tr></table></figure>



<h2 id="二、ARM安装Mysql（裸机）"><a href="#二、ARM安装Mysql（裸机）" class="headerlink" title="二、ARM安装Mysql（裸机）"></a>二、ARM安装Mysql（裸机）</h2><p>平台信息：</p>
<p>OS : ky10</p>
<p>CPU :KUNPENG.v920</p>
<p>MYSQL信息：</p>
<p>版本：8.0.25（Red Hat Enterprise Linux 7 &#x2F; Oracle Linux 7 (ARM, 64-bit)） </p>
<h3 id="1、卸载"><a href="#1、卸载" class="headerlink" title="1、卸载"></a>1、卸载</h3><p>查询是否已安装mariadb</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">rpm -qa mariadb*  或 rpm -qa |grep mariadb</span><br></pre></td></tr></table></figure>

<p>卸载mariadb与依赖关系的软件包</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum remove -y `rpm -qa mariadb*`</span><br></pre></td></tr></table></figure>

<h3 id="2、-下载"><a href="#2、-下载" class="headerlink" title="2、 下载"></a>2、 下载</h3><p>​        下载RPM Bundle，其中包含所有依赖的RPM安装包</p>
<p>(mysql-8.0.25-1.el7.aarch64.rpm-bundle.tar)</p>
<p>(compat-openssl10-1.0.2o-3.el8.aarch64.rpm)</p>
<p>下载地址：<a target="_blank" rel="noopener" href="https://downloads.mysql.com/archives/community/">https://downloads.mysql.com/archives/community/</a></p>
<h3 id="3、安装"><a href="#3、安装" class="headerlink" title="3、安装"></a>3、安装</h3><p>​        2.1 上传至服务器，解压</p>
<pre><code>    tar -zxvf mysql-8.0.26-1.el8.aarch64.rpm-bundle.tar
</code></pre>
<h3 id="4、-按照以下顺序安装需要的包"><a href="#4、-按照以下顺序安装需要的包" class="headerlink" title="4、 按照以下顺序安装需要的包"></a>4、 按照以下顺序安装需要的包</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">rpm -ivh mysql-community-client-plugins-8.0.26-1.el8.aarch64.rpm</span><br><span class="line">rpm -ivh mysql-community-common-8.0.26-1.el8.aarch64.rpm</span><br><span class="line">rpm -ivh mysql-community-libs-8.0.26-1.el8.aarch64.rpm</span><br><span class="line">rpm -ivh mysql-community-client-8.0.26-1.el8.aarch64.rpm</span><br><span class="line">rpm -ivh mysql-community-server-8.0.26-1.el8.aarch64.rpm</span><br></pre></td></tr></table></figure>

<p><strong>有错误看常见错误</strong></p>
<h3 id="5、-初始化"><a href="#5、-初始化" class="headerlink" title="5、 初始化"></a>5、 初始化</h3><p>​        #用户可以随意，我用的root用户</p>
<pre><code>    mysqld --initialize-insecure --user=root
</code></pre>
<h3 id="6、-启动"><a href="#6、-启动" class="headerlink" title="6、 启动"></a>6、 启动</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">systemctl start mysqld</span><br></pre></td></tr></table></figure>

<pre><code>    补充命令：
    启动mysql服务：systemctl start mysqld.service
    停止mysql服务：systemctl stop mysqld.service
    重启mysql服务：systemctl restart mysqld.service
    查看mysql服务当前状态：    systemctl status mysqld.service
    设置mysql服务开机自启动： systemctl enable mysqld.service
    停止mysql服务开机自启动： systemctl disable mysqld.service
</code></pre>
<h3 id="常见错误："><a href="#常见错误：" class="headerlink" title="常见错误："></a>常见错误：</h3><p><strong>错误提示：libLLVM-7.so不是符号连接</strong></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">sudo find / -name &quot;libLLVM*&quot;</span><br><span class="line">/usr/lib64/libLLVM-10.so</span><br><span class="line">/usr/lib64/libLLVM-7.0.0.so</span><br><span class="line">/usr/lib64/libLLVM-7.so</span><br><span class="line">/usr/lib64/libLLVM-10.0.1.so</span><br><span class="line">然后查看</span><br><span class="line">ls /usr/lib64/libLL* -la</span><br><span class="line">lrwxrwxrwx. 1 root root       13 12月  8 14:35 /usr/lib64/libLLVM-10.0.1.so -&gt; libLLVM-10.so</span><br><span class="line">-rwxr-xr-x. 1 root root 84012704 12月  8 14:35 /usr/lib64/libLLVM-10.so</span><br><span class="line">-rwxr-xr-x. 1 root root 55552296 10月  9 17:45 /usr/lib64/libLLVM-7.0.0.so</span><br><span class="line">-rwxr-xr-x. 1 root root 55552296 10月  9 17:45 /usr/lib64/libLLVM-7.so</span><br><span class="line">发现ibLLVM-7.so确实没有连接</span><br><span class="line">手动建立连接</span><br><span class="line">sudo ln -sf /usr/lib64/libLLVM-7.0.0.so /usr/lib64/libLLVM-7.so</span><br><span class="line">错误提示消失。</span><br><span class="line"> </span><br><span class="line">sudo ldconfig</span><br><span class="line">sudo ldconfig -v</span><br><span class="line">会自动处理ld.so.conf和ld.so.conf.d </span><br><span class="line">文件默认放在/lib和/usr/lib</span><br><span class="line">临时配置可使用命令</span><br><span class="line">export LD_LIBRARY_PATH=/usr/lib/****:/usr/local/lib/****</span><br></pre></td></tr></table></figure>

<p><strong>启动报错</strong></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">find / -name mysqld.log</span><br><span class="line"></span><br><span class="line">首先检查了 mysqld.log 日志，得到了报错的日志信息</span><br><span class="line">The innodb_system data file &#x27;ibdata1&#x27; must be writable</span><br><span class="line">根据日志信息知道了是 ‘ibdata1’ 数据文件必须是可写的</span><br><span class="line">所以更改权限即可</span><br><span class="line">输入</span><br><span class="line">chmod -R 777 /var/lib/mysql</span><br><span class="line">然后重新启动服务</span><br><span class="line">service mysqld start</span><br></pre></td></tr></table></figure>




<h2 id="三、docker安装部署Tomcat"><a href="#三、docker安装部署Tomcat" class="headerlink" title="三、docker安装部署Tomcat"></a>三、docker安装部署Tomcat</h2><h3 id="1、搜索tomcat镜像"><a href="#1、搜索tomcat镜像" class="headerlink" title="1、搜索tomcat镜像"></a>1、搜索tomcat镜像</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker search tomcat</span><br></pre></td></tr></table></figure>

<h3 id="2、拉取tomcat镜像"><a href="#2、拉取tomcat镜像" class="headerlink" title="2、拉取tomcat镜像"></a>2、拉取tomcat镜像</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker pull tomcat</span><br></pre></td></tr></table></figure>

<h3 id="3、创建容器，设置端口映射、目录映射"><a href="#3、创建容器，设置端口映射、目录映射" class="headerlink" title="3、创建容器，设置端口映射、目录映射"></a>3、创建容器，设置端口映射、目录映射</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在/root目录下创建tomcat目录用于存储tomcat数据信息</span></span><br><span class="line">mkdir ~/tomcat</span><br><span class="line">cd ~/tomcat</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">docker run -id --name=c_tomcat \</span><br><span class="line">-p 8080:8080 \</span><br><span class="line">-v $PWD:/usr/local/tomcat/webapps \</span><br><span class="line">tomcat </span><br></pre></td></tr></table></figure>

<ul>
<li><p>参数说明：</p>
<ul>
<li><p><strong>-p 8080:8080：</strong>将容器的8080端口映射到主机的8080端口</p>
<p><strong>-v $PWD:&#x2F;usr&#x2F;local&#x2F;tomcat&#x2F;webapps：</strong>将主机中当前目录挂载到容器的webapps</p>
</li>
</ul>
</li>
</ul>
<h3 id="4、测试"><a href="#4、测试" class="headerlink" title="4、测试"></a>4、测试</h3><p>使用外部机器访问tomcat</p>
<h2 id="三、docker安装部署Nginx"><a href="#三、docker安装部署Nginx" class="headerlink" title="三、docker安装部署Nginx"></a>三、docker安装部署Nginx</h2><h3 id="1、搜索nginx镜像"><a href="#1、搜索nginx镜像" class="headerlink" title="1、搜索nginx镜像"></a>1、搜索nginx镜像</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker search nginx</span><br></pre></td></tr></table></figure>

<h3 id="2、拉取nginx镜像"><a href="#2、拉取nginx镜像" class="headerlink" title="2、拉取nginx镜像"></a>2、拉取nginx镜像</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker pull nginx</span><br></pre></td></tr></table></figure>

<h3 id="3、创建容器，设置端口映射、目录映射-1"><a href="#3、创建容器，设置端口映射、目录映射-1" class="headerlink" title="3、创建容器，设置端口映射、目录映射"></a>3、创建容器，设置端口映射、目录映射</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在/root目录下创建nginx目录用于存储nginx数据信息</span></span><br><span class="line">mkdir ~/nginx</span><br><span class="line">cd ~/nginx</span><br><span class="line">mkdir conf</span><br><span class="line">cd conf</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在~/nginx/conf/下创建nginx.conf文件,粘贴下面内容</span></span><br><span class="line">vim nginx.conf</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line">user  nginx;</span><br><span class="line">worker_processes  1;</span><br><span class="line"></span><br><span class="line">error_log  /var/log/nginx/error.log warn;</span><br><span class="line">pid        /var/run/nginx.pid;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">events &#123;</span><br><span class="line">    worker_connections  1024;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">http &#123;</span><br><span class="line">    include       /etc/nginx/mime.types;</span><br><span class="line">    default_type  application/octet-stream;</span><br><span class="line"></span><br><span class="line">    log_format  main  &#x27;$remote_addr - $remote_user [$time_local] &quot;$request&quot; &#x27;</span><br><span class="line">                      &#x27;$status $body_bytes_sent &quot;$http_referer&quot; &#x27;</span><br><span class="line">                      &#x27;&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;&#x27;;</span><br><span class="line"></span><br><span class="line">    access_log  /var/log/nginx/access.log  main;</span><br><span class="line"></span><br><span class="line">    sendfile        on;</span><br><span class="line">    #tcp_nopush     on;</span><br><span class="line"></span><br><span class="line">    keepalive_timeout  65;</span><br><span class="line"></span><br><span class="line">    #gzip  on;</span><br><span class="line"></span><br><span class="line">    include /etc/nginx/conf.d/*.conf;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>




<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">docker run -id --name=c_nginx \</span><br><span class="line">-p 80:80 \</span><br><span class="line">-v $PWD/conf/nginx.conf:/etc/nginx/nginx.conf \</span><br><span class="line">-v $PWD/logs:/var/log/nginx \</span><br><span class="line">-v $PWD/html:/usr/share/nginx/html \</span><br><span class="line">nginx</span><br></pre></td></tr></table></figure>

<ul>
<li>参数说明：<ul>
<li><strong>-p 80:80</strong>：将容器的 80端口映射到宿主机的 80 端口。</li>
<li><strong>-v $PWD&#x2F;conf&#x2F;nginx.conf:&#x2F;etc&#x2F;nginx&#x2F;nginx.conf</strong>：将主机当前目录下的 &#x2F;conf&#x2F;nginx.conf 挂载到容器的 :&#x2F;etc&#x2F;nginx&#x2F;nginx.conf。配置目录</li>
<li><strong>-v $PWD&#x2F;logs:&#x2F;var&#x2F;log&#x2F;nginx</strong>：将主机当前目录下的 logs 目录挂载到容器的&#x2F;var&#x2F;log&#x2F;nginx。日志目录</li>
</ul>
</li>
</ul>
<h3 id="4、测试-1"><a href="#4、测试-1" class="headerlink" title="4、测试"></a>4、测试</h3><p>使用外部机器访问nginx</p>
<h2 id="四、docker安装部署Redis"><a href="#四、docker安装部署Redis" class="headerlink" title="四、docker安装部署Redis"></a>四、docker安装部署Redis</h2><h3 id="1、搜索redis镜像"><a href="#1、搜索redis镜像" class="headerlink" title="1、搜索redis镜像"></a>1、搜索redis镜像</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker search redis</span><br></pre></td></tr></table></figure>

<h3 id="2、拉取redis镜像"><a href="#2、拉取redis镜像" class="headerlink" title="2、拉取redis镜像"></a>2、拉取redis镜像</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker pull redis:5.0</span><br></pre></td></tr></table></figure>

<h3 id="3、创建容器，设置端口映射"><a href="#3、创建容器，设置端口映射" class="headerlink" title="3、创建容器，设置端口映射"></a>3、创建容器，设置端口映射</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker run -id --name=c_redis -p 6379:6379 redis:5.0</span><br></pre></td></tr></table></figure>

<h3 id="4、测试-2"><a href="#4、测试-2" class="headerlink" title="4、测试"></a>4、测试</h3><p>使用外部机器连接redis</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./redis-cli.exe -h 192.168.x.x -p 6379</span><br></pre></td></tr></table></figure>



<h2 id="五、docker安装部署postgreSQL"><a href="#五、docker安装部署postgreSQL" class="headerlink" title="五、docker安装部署postgreSQL"></a>五、docker安装部署postgreSQL</h2><h3 id="1、搜索postgres镜像"><a href="#1、搜索postgres镜像" class="headerlink" title="1、搜索postgres镜像"></a>1、搜索postgres镜像</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker search postgres</span><br></pre></td></tr></table></figure>

<h3 id="2、拉取postgres镜像"><a href="#2、拉取postgres镜像" class="headerlink" title="2、拉取postgres镜像"></a>2、拉取postgres镜像</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker pull postgres:14-alpine</span><br></pre></td></tr></table></figure>

<h3 id="3、创建挂载目录"><a href="#3、创建挂载目录" class="headerlink" title="3、创建挂载目录"></a>3、创建挂载目录</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mkdir -p /data/postgresql/data</span><br></pre></td></tr></table></figure>

<h3 id="4、创建容器，设置端口映射"><a href="#4、创建容器，设置端口映射" class="headerlink" title="4、创建容器，设置端口映射"></a>4、创建容器，设置端口映射</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker run -d --name=postgresql -p 5432:5432  -v /data/postgresql/data:/var/lib/postgresql/data -e POSTGRES_PASSWORD=Zz@2020 postgres:14-alpine</span><br></pre></td></tr></table></figure>

<h3 id="5、修改密码（可选）"><a href="#5、修改密码（可选）" class="headerlink" title="5、修改密码（可选）"></a>5、修改密码（可选）</h3><p>1.进入docker 容器 </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker exec -it postgres96 /bin/sh</span><br></pre></td></tr></table></figure>

<p>2.连接数据库 </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">psql -U postgres</span><br></pre></td></tr></table></figure>

<p>3.键入命令修改postgres用户密码：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ALTER USER postgres WITH PASSWORD &#x27;ST1q@W3e4r&#x27;;</span><br></pre></td></tr></table></figure>




      
    </div>
    <footer class="article-footer">
      
        <div id="donation_div"></div>


<script src="/qingfeng-blog/js/vdonate.js"></script>

<script>
var a = new Donate({
  title: '如果觉得我的文章对您有用，请随意打赏。您的支持将鼓励我继续创作!', // 可选参数，打赏标题
  btnText: 'Donate', // 可选参数，打赏按钮文字
  el: document.getElementById('donation_div'),
  wechatImage: 'http://img.lindaifeng.vip/typora-picgo-tuchaung/20230428150832.png',
  alipayImage: 'http://img.lindaifeng.vip/typora-picgo-tuchaung/20230428150823.png'
});
</script>
      
      
      <div>
        <ul class="post-copyright">
          <li class="post-copyright-author">
          <strong>Post author:  </strong>清峰</a>
          </li>
          <li class="post-copyright-link">
          <strong>Post link:  </strong>
          <a href="/qingfeng-blog/2023/04/19/运维安装/Linux docker安装各软件(汇总)/" target="_blank" title="docker安装各软件（汇总）">http://example.com/2023/04/19/运维安装/Linux docker安装各软件(汇总)/</a>
          </li>
          <li class="post-copyright-license">
            <strong>Copyright Notice:   </strong>
            All articles in this blog are licensed under <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">CC BY-NC-ND 4.0</a>
            unless stating additionally.
          </li>
         
        </ul>
<div>

      
      
        
	<div id="comment">
		<!-- 来必力City版安装代码 -->
		<div id="lv-container" data-id="city" data-uid="MTAyMC8yOTQ4MS82MDQ5">
		<script type="text/javascript">
		   (function(d, s) {
		       var j, e = d.getElementsByTagName(s)[0];

		       if (typeof LivereTower === 'function') { return; }

		       j = d.createElement(s);
		       j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
		       j.async = true;

		       e.parentNode.insertBefore(j, e);
		   })(document, 'script');
		</script>
		<noscript>为正常使用来必力评论功能请激活JavaScript</noscript>
		</div>
		<!-- City版安装代码已完成 -->
	</div>



      
      
        
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/qingfeng-blog/tags/docker/" rel="tag">docker</a></li></ul>

      

    </footer>
  </div>
</div>
  
    
<nav id="article-nav">
  
    <a href="/qingfeng-blog/2023/04/24/Linux/Centos7%E6%8C%82%E8%BD%BD%E7%A1%AC%E7%9B%98/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          Centos7挂载硬盘
        
      </div>
    </a>
  
  
    <a href="/qingfeng-blog/2023/02/28/%E8%BF%90%E7%BB%B4%E5%AE%89%E8%A3%85/Linux%20docker%E5%AE%89%E8%A3%85ELK/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Linux docker安装ELK</div>
    </a>
  
</nav>

  
</article>

<!-- Table of Contents -->

  <aside id="toc-sidebar">
    <div id="toc" class="toc-article">
    <strong class="toc-title">Contents</strong>
    
        <ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Docker%E5%AE%89%E8%A3%85%E5%90%84%E8%BD%AF%E4%BB%B6%EF%BC%88%E6%B1%87%E6%80%BB%EF%BC%89"><span class="nav-number">1.</span> <span class="nav-text">Docker安装各软件（汇总）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%80%E3%80%81docker%E5%AE%89%E8%A3%85oracle-12c"><span class="nav-number">2.</span> <span class="nav-text">一、docker安装oracle-12c</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1%E3%80%81%E6%8B%89%E5%8F%96oracle-12c%E9%95%9C%E5%83%8F"><span class="nav-number">2.1.</span> <span class="nav-text">1、拉取oracle-12c镜像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2%E3%80%81%E5%88%9B%E5%BB%BA%E5%B9%B6%E5%90%AF%E5%8A%A8%E5%AE%B9%E5%99%A8"><span class="nav-number">2.2.</span> <span class="nav-text">2、创建并启动容器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3%E3%80%81%E4%BF%AE%E6%94%B9oracle%E8%B4%A6%E5%8F%B7%E5%AF%86%E7%A0%81%E8%AE%BE%E7%BD%AE"><span class="nav-number">2.3.</span> <span class="nav-text">3、修改oracle账号密码设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4%E3%80%81%E7%89%A9%E7%90%86%E6%9C%BA%E8%BF%9E%E6%8E%A5oracle-12c"><span class="nav-number">2.4.</span> <span class="nav-text">4、物理机连接oracle-12c</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%8B%93%E5%B1%95"><span class="nav-number">2.5.</span> <span class="nav-text">拓展</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Oracle%E5%88%9B%E5%BB%BA%E8%A1%A8%E7%A9%BA%E9%97%B4%E4%B8%8E%E7%94%A8%E6%88%B7"><span class="nav-number">2.6.</span> <span class="nav-text">Oracle创建表空间与用户</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%87%8D%E5%90%AFOracle%E6%9C%8D%E5%8A%A1"><span class="nav-number">2.7.</span> <span class="nav-text">重启Oracle服务</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9B%B4%E5%A4%9A%E5%B8%B8%E7%94%A8%E2%80%A6"><span class="nav-number">2.8.</span> <span class="nav-text">更多常用…</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BA%8C%E3%80%81docker%E5%AE%89%E8%A3%85mysql"><span class="nav-number">3.</span> <span class="nav-text">二、docker安装mysql</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA%E7%AC%AC%E4%B8%80%E5%8F%B0mysql-1"><span class="nav-number">3.1.</span> <span class="nav-text">创建第一台mysql-1</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA%E7%AC%AC%E4%BA%8C%E5%8F%B0mysql-2"><span class="nav-number">3.2.</span> <span class="nav-text">创建第二台mysql-2</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BA%8C%E3%80%81ARM%E5%AE%89%E8%A3%85Mysql%EF%BC%88%E8%A3%B8%E6%9C%BA%EF%BC%89"><span class="nav-number">4.</span> <span class="nav-text">二、ARM安装Mysql（裸机）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1%E3%80%81%E5%8D%B8%E8%BD%BD"><span class="nav-number">4.1.</span> <span class="nav-text">1、卸载</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2%E3%80%81-%E4%B8%8B%E8%BD%BD"><span class="nav-number">4.2.</span> <span class="nav-text">2、 下载</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3%E3%80%81%E5%AE%89%E8%A3%85"><span class="nav-number">4.3.</span> <span class="nav-text">3、安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4%E3%80%81-%E6%8C%89%E7%85%A7%E4%BB%A5%E4%B8%8B%E9%A1%BA%E5%BA%8F%E5%AE%89%E8%A3%85%E9%9C%80%E8%A6%81%E7%9A%84%E5%8C%85"><span class="nav-number">4.4.</span> <span class="nav-text">4、 按照以下顺序安装需要的包</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5%E3%80%81-%E5%88%9D%E5%A7%8B%E5%8C%96"><span class="nav-number">4.5.</span> <span class="nav-text">5、 初始化</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#6%E3%80%81-%E5%90%AF%E5%8A%A8"><span class="nav-number">4.6.</span> <span class="nav-text">6、 启动</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%B8%B8%E8%A7%81%E9%94%99%E8%AF%AF%EF%BC%9A"><span class="nav-number">4.7.</span> <span class="nav-text">常见错误：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%89%E3%80%81docker%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2Tomcat"><span class="nav-number">5.</span> <span class="nav-text">三、docker安装部署Tomcat</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1%E3%80%81%E6%90%9C%E7%B4%A2tomcat%E9%95%9C%E5%83%8F"><span class="nav-number">5.1.</span> <span class="nav-text">1、搜索tomcat镜像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2%E3%80%81%E6%8B%89%E5%8F%96tomcat%E9%95%9C%E5%83%8F"><span class="nav-number">5.2.</span> <span class="nav-text">2、拉取tomcat镜像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3%E3%80%81%E5%88%9B%E5%BB%BA%E5%AE%B9%E5%99%A8%EF%BC%8C%E8%AE%BE%E7%BD%AE%E7%AB%AF%E5%8F%A3%E6%98%A0%E5%B0%84%E3%80%81%E7%9B%AE%E5%BD%95%E6%98%A0%E5%B0%84"><span class="nav-number">5.3.</span> <span class="nav-text">3、创建容器，设置端口映射、目录映射</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4%E3%80%81%E6%B5%8B%E8%AF%95"><span class="nav-number">5.4.</span> <span class="nav-text">4、测试</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%89%E3%80%81docker%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2Nginx"><span class="nav-number">6.</span> <span class="nav-text">三、docker安装部署Nginx</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1%E3%80%81%E6%90%9C%E7%B4%A2nginx%E9%95%9C%E5%83%8F"><span class="nav-number">6.1.</span> <span class="nav-text">1、搜索nginx镜像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2%E3%80%81%E6%8B%89%E5%8F%96nginx%E9%95%9C%E5%83%8F"><span class="nav-number">6.2.</span> <span class="nav-text">2、拉取nginx镜像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3%E3%80%81%E5%88%9B%E5%BB%BA%E5%AE%B9%E5%99%A8%EF%BC%8C%E8%AE%BE%E7%BD%AE%E7%AB%AF%E5%8F%A3%E6%98%A0%E5%B0%84%E3%80%81%E7%9B%AE%E5%BD%95%E6%98%A0%E5%B0%84-1"><span class="nav-number">6.3.</span> <span class="nav-text">3、创建容器，设置端口映射、目录映射</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4%E3%80%81%E6%B5%8B%E8%AF%95-1"><span class="nav-number">6.4.</span> <span class="nav-text">4、测试</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9B%9B%E3%80%81docker%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2Redis"><span class="nav-number">7.</span> <span class="nav-text">四、docker安装部署Redis</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1%E3%80%81%E6%90%9C%E7%B4%A2redis%E9%95%9C%E5%83%8F"><span class="nav-number">7.1.</span> <span class="nav-text">1、搜索redis镜像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2%E3%80%81%E6%8B%89%E5%8F%96redis%E9%95%9C%E5%83%8F"><span class="nav-number">7.2.</span> <span class="nav-text">2、拉取redis镜像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3%E3%80%81%E5%88%9B%E5%BB%BA%E5%AE%B9%E5%99%A8%EF%BC%8C%E8%AE%BE%E7%BD%AE%E7%AB%AF%E5%8F%A3%E6%98%A0%E5%B0%84"><span class="nav-number">7.3.</span> <span class="nav-text">3、创建容器，设置端口映射</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4%E3%80%81%E6%B5%8B%E8%AF%95-2"><span class="nav-number">7.4.</span> <span class="nav-text">4、测试</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BA%94%E3%80%81docker%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2postgreSQL"><span class="nav-number">8.</span> <span class="nav-text">五、docker安装部署postgreSQL</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1%E3%80%81%E6%90%9C%E7%B4%A2postgres%E9%95%9C%E5%83%8F"><span class="nav-number">8.1.</span> <span class="nav-text">1、搜索postgres镜像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2%E3%80%81%E6%8B%89%E5%8F%96postgres%E9%95%9C%E5%83%8F"><span class="nav-number">8.2.</span> <span class="nav-text">2、拉取postgres镜像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3%E3%80%81%E5%88%9B%E5%BB%BA%E6%8C%82%E8%BD%BD%E7%9B%AE%E5%BD%95"><span class="nav-number">8.3.</span> <span class="nav-text">3、创建挂载目录</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4%E3%80%81%E5%88%9B%E5%BB%BA%E5%AE%B9%E5%99%A8%EF%BC%8C%E8%AE%BE%E7%BD%AE%E7%AB%AF%E5%8F%A3%E6%98%A0%E5%B0%84"><span class="nav-number">8.4.</span> <span class="nav-text">4、创建容器，设置端口映射</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5%E3%80%81%E4%BF%AE%E6%94%B9%E5%AF%86%E7%A0%81%EF%BC%88%E5%8F%AF%E9%80%89%EF%BC%89"><span class="nav-number">8.5.</span> <span class="nav-text">5、修改密码（可选）</span></a></li></ol></li></ol>
    
    </div>
  </aside>


</section>
        
      </div>
      
      <footer id="footer">
  

  <div class="container">
      	<div class="row">
	      <!-- <p> Powered by <a href="http://hexo.io/" target="_blank">Hexo</a> and <a href="https://github.com/iTimeTraveler/hexo-theme-hiker" target="_blank">Hexo-theme-hiker</a> </p> -->
	      <p>May there be no bug in the world！</p>
        <p id="copyRightEn">Copyright &copy; 2022 - 2023 All Rights Reserved.</p>
	      
	      
    		<p class="busuanzi_uv">
				UV : <span id="busuanzi_value_site_uv"></span> |  
				PV : <span id="busuanzi_value_site_pv"></span>
		    </p>
  		   
		</div>

		
  </div>
</footer>


<!-- min height -->

<script>
    var wrapdiv = document.getElementById("wrap");
    var contentdiv = document.getElementById("content");
    var allheader = document.getElementById("allheader");

    wrapdiv.style.minHeight = document.body.offsetHeight + "px";
    if (allheader != null) {
      contentdiv.style.minHeight = document.body.offsetHeight - allheader.offsetHeight - document.getElementById("footer").offsetHeight + "px";
    } else {
      contentdiv.style.minHeight = document.body.offsetHeight - document.getElementById("footer").offsetHeight + "px";
    }
</script>
    </div>
    <!-- <nav id="mobile-nav">
  
    <a href="/qingfeng-blog/" class="mobile-nav-link">首页</a>
  
    <a href="/qingfeng-blog/categories" class="mobile-nav-link">分类</a>
  
    <a href="/qingfeng-blog/tags" class="mobile-nav-link">标签</a>
  
</nav> -->
    

<!-- mathjax config similar to math.stackexchange -->

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      processEscapes: true
    }
  });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
    });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for(i=0; i < all.length; i += 1) {
            all[i].SourceElement().parentNode.className += ' has-jax';
        }
    });
</script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>


  
<link rel="stylesheet" href="/qingfeng-blog/fancybox/jquery.fancybox.css">

  
<script src="/qingfeng-blog/fancybox/jquery.fancybox.pack.js"></script>




<script src="/qingfeng-blog/js/scripts.js"></script>



  
<script src="/qingfeng-blog/js/home.js"></script>




  
<script src="/qingfeng-blog/js/dialog.js"></script>









	<div style="display: none;">
    <script src="https://s95.cnzz.com/z_stat.php?id=1260716016&web_id=1260716016" language="JavaScript"></script>
  </div>



	<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js">
	</script>






  </div>

  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h2 class="modal-title" id="myModalLabel">设置</h2>
      </div>
      <hr style="margin-top:0px; margin-bottom:0px; width:80%; border-top: 3px solid #000;">
      <hr style="margin-top:2px; margin-bottom:0px; width:80%; border-top: 1px solid #000;">


      <div class="modal-body">
          <div style="margin:6px;">
            <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" onclick="javascript:setFontSize();" aria-expanded="true" aria-controls="collapseOne">
              正文字号大小
            </a>
          </div>
          <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
          <div class="panel-body">
            您已调整页面字体大小
          </div>
        </div>
      


          <div style="margin:6px;">
            <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" onclick="javascript:setBackground();" aria-expanded="true" aria-controls="collapseTwo">
              夜间护眼模式
            </a>
        </div>
          <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
          <div class="panel-body">
            夜间模式已经开启，再次单击按钮即可关闭 
          </div>
        </div>

        <div>
            <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="true" aria-controls="collapseThree">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;关 于&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
        </div>
         <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
          <div class="panel-body">
            清峰小栈
          </div>
          <div class="panel-body">
            Copyright © 2023 清峰 All Rights Reserved.
          </div>
        </div>
      </div>


      <hr style="margin-top:0px; margin-bottom:0px; width:80%; border-top: 1px solid #000;">
      <hr style="margin-top:2px; margin-bottom:0px; width:80%; border-top: 3px solid #000;">
      <div class="modal-footer">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
      </div>
    </div>
  </div>
</div>
  
  <a id="rocket" href="#top" class=""></a>
  <script type="text/javascript" src="/qingfeng-blog/js/totop.js?v=1.0.0" async=""></script>
  
    <a id="menu-switch"><i class="fa fa-bars fa-lg"></i></a>
  
</body>
</html>